package com.codingapi.mybatisdemo1.service.impl;


import com.codingapi.mybatisdemo1.mapper.TestMapper;
import com.codingapi.mybatisdemo1.service.TestService;
import com.codingapi.tx.annotation.ITxTransaction;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @描述: alf
 * @创建人: ljf
 * @创建时间: 2018-04-09 11:38
 */
@Service
public class TestServiceImpl implements TestService,ITxTransaction {

    @Autowired
    private TestMapper testMapper;

    @Override
    @Transactional
    public int save(String name, Integer id) {
        testMapper.save(name,id);
       int i=1/0;
        return 2;
    }
}
